package com.happyfamily.springboot.crowdsourcingplatform.service.pan.impl;

import com.happyfamily.springboot.crowdsourcingplatform.base.result.Results;
import com.happyfamily.springboot.crowdsourcingplatform.dao.pan.OrderUserDao;
import com.happyfamily.springboot.crowdsourcingplatform.model.Orders;
import com.happyfamily.springboot.crowdsourcingplatform.service.pan.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author Administrator
 * @create 2020/02/28 11:16
 */
@Service
public class OrderServiceImpl implements OrderService
{
	@Autowired
	 private OrderUserDao orderUserDao;

	@Override
	public int addOrder(String wid, String account)
	{
		return orderUserDao.addOrderUser(wid,account);
	}

	@Override
	public Results<Orders> getOrderListByPage(Integer offset, Integer limit, String account)
	{
		return Results.success(orderUserDao.countUserOrder(account).intValue(), orderUserDao.getUserOderList(offset, limit,account));
	}

	@Override
	public void addOrderForm(Integer oid)
	{
		orderUserDao.addOrderFrom(oid);
	}
}
